package com.seewo.dubbo.debugger.common;

import java.lang.reflect.Method;

/**
 * @author chenliangliang
 * @date 2018/7/26
 */
public class Util {

    private Util() {
    }

    public static String getMethodName(Method method) {
        StringBuilder sb = new StringBuilder();
        sb.append(method.getName()).append("(");
        Class<?>[] parameterTypes = method.getParameterTypes();
        for (Class<?> type : parameterTypes) {
            sb.append(type.getName()).append(",");
        }
        int i = sb.length() - 1;
        if (sb.charAt(i) == ',') {
            sb.deleteCharAt(i);
        }
        sb.append(")");
        return sb.toString();
    }
}
